<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@taglib prefix="webtag" uri="http://www.iflexsys.tagslib.com.vn"%>
<html>
<head>
<!--  date picker script -->
<!--end form -->
<title>Thông tin Banner</title>
<script type="text/javascript">
	$(function() {
		$('input').checkBox();
		$('#toggle-all').click(function() {
			$('#toggle-all').toggleClass('toggle-checked');
			$('#mainform input[type=checkbox]').checkBox('toggle');
			return false;
		});
		$('.askDelBanner').jConfirmAction();
	});
</script>

<!--  styled select box script version 2 -->

<script type="text/javascript">
	$(document).ready(function() {
		$('.styledselect_form_1').selectbox({
			inputClass : "styledselect_form_1"
		});
		$('.styledselect_form_2').selectbox({
			inputClass : "styledselect_form_2"
		});
	});
</script>

</head>
<body>
	<div>
		<form id="searchBanner" action="searchBanner" method="POST">
			<h2>
				Thông tin Banner
			</h2>
			<input type="image" class="search_submit" src="<spring:theme code="theme.admin.images"/>/search.png" /> 
			<input type="text" name="keyword" class="search_input" placeholder="search keyword" value="${keyword}" /> 
			<input type="hidden" id="pageIndexId" name="pageIndex" value="1">
		</form>

		<table id="rounded-corner" summary="2007 Major IT Companies' Profit">
			<thead>
				<tr>
					<th scope="col" class="rounded-company"></th>
					<th scope="col" class="rounded">Tên File</th>
					<th scope="col" class="rounded">Loại</th>
					<th scope="col" class="rounded">Ngày tạo file</th>
					<th scope="col" class="rounded">Xem chi tiết</th>
					<th scope="col" class="rounded-q4">Xóa</th>
				</tr>
			</thead>
			
				<c:choose>
					<c:when test="${empty listBanner}">
						<tfoot><tr> <td colspan="8" align="center">Không tìm thấy bản ghi nào phù hợp </td></tr></tfoot>
					</c:when>
					<c:otherwise>
						<tbody>
						<c:forEach var="item" items="${listBanner}">
						<tr>
							<td></td>
							<td>${item.nameFile}</td>
							<td>
								<c:if test="${item.type == 'BANNER' }">
									Banner
								</c:if>
								<c:if test="${item.type == 'ADVERTISING' }">
									Quảng Cáo
								</c:if>
							</td>
							<td><fmt:formatDate value="${item.createDate }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
							
							<td><a class="fancyboxDemo"
								href="ajax/viewDetailBanner?id=${item.id}">Xem</a> <%-- <b> / </b> <a href="#"><img
									src="<spring:theme code="theme.admin.images"/>/user_edit.png"
									alt="" title="" border="0" /></a> --%></td>
							<td><a href="delete-banner?id=${item.id}" class="askDelBanner"><img
									src="<spring:theme code="theme.admin.images"/>/trash.png" alt=""
									title="" border="0" /></a></td>
						</tr>
						</c:forEach>
						<tbody>
					</c:otherwise>
				</c:choose>
			</tbody>
		</table>
		<c:if test="${fn:length(listBanner) > 0}">
			<div class="pagination">
				<webtag:pagination pagingInfo="${pagingInfo}"
					pageIndexId="pageIndexId" formId="searchBanner" />
			</div>
		</c:if>
	</div>
</body>
</html>